//
//  GongLvButtomCollectionViewCell.m
//  礼物说
//
//  Created by dllo on 16/4/27.
//  Copyright © 2016年 sunzhichao. All rights reserved.
//

#import "GongLvButtomCollectionViewCell.h"

@interface GongLvButtomCollectionViewCell ()

@property (nonatomic, retain) BaseLabel *title;

@end

@implementation GongLvButtomCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createCell];
    }
    return self;
}
- (void)dealloc{
    
    [_number release];
    [_imgView release];
    [_title release];
    [super dealloc];
}
- (void)setNumber:(NSNumber *)number{
    
    if (_number != number) {
        [_number release];
        _number = [number retain];
    }
    _title.text = [_number description];
    
}
- (void)createCell{
    
    self.imgView = [[BaseImageView alloc] init];
    [self.contentView addSubview:_imgView];
    [_imgView release];
    
    
    self.title = [[BaseLabel alloc] init];
    [self.contentView addSubview:_title];
    [_title release];
    
    
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    
    _imgView.frame = CGRectMake(kWIDTHS(20), kWIDTHS(10), kWIDTHS(30), kHEIGHTS(30));
    
    _title.frame = CGRectMake(kWIDTHCELL / 2, 0, kWIDTHCELL / 2, kHEIGHTCELL);
    _title.textColor = [UIColor grayColor];
}

@end
